<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('茶店信息列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" id="warehouseId" name="warehouseId" th:value="${warehouse.id}">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>茶店电话：</label>
                            <input type="text" name="phone"/>
                        </li>
                        <li>
                            <label>茶店地址：</label>
                            <input type="text" name="address"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/warehouse";

    $(function() {
        var options = {
            url: prefix + "/warehouseInventory/chooseTeaShop/chooseTeaShopList",
            modalName: "茶店信息",
            columns: [{
                checkbox: true
            },
            {
                field: 'id',
                title: '茶店编号',
            },
            {
                field: 'phone',
                title: '茶店电话'
            },
            {
                field: 'address',
                title: '地址'
            }]
        };
        $.table.init(options);
    });
        /* 添加用户-选择用户-提交 */
		function submitHandler() {
			var rows = $.table.selectFirstColumns();
			if (rows.length == 0 || rows.length > 1) {
       			$.modal.alertWarning("只能选择一条记录！");
       			return;
       		}
			var url = prefix + '/warehouseInventory/deliverMaterial/' + $("#warehouseId").val() + '/' + rows.join();
			$.modal.close();
		    $.modal.open("选择发货数量", url);
		}
</script>


</body>
</html>